package com.autumn.annotations.transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * ClassName: service
 *
 * @Description:
 * @Author: wangqiuyang
 * @Date: 2022/1/27 11:15 上午
 * History:
 * <author>          <time>          <version>          <desc>
 * wangqiuyang    2022/1/27 11:15 上午   @Version 1.0        描述
 */
@Component
public class Service {

    @Autowired
    private Dao dao;

    @Transactional
    public void insert(boolean isError) {
        dao.insert();

        if (isError) {
            int i =  1 / 0;
        }
    }
}
